﻿using System;
using DevExpress.XtraBars;
using UniMana.Data;
namespace UniMana.Win.Leadership
{
    public partial class FrmReport_SubStudent_Course : DevExpress.XtraEditors.XtraForm
    {
        private DBMain m_ReportStudent_Course = new DBMain();

        public FrmReport_SubStudent_Course()
        {
            InitializeComponent();
            InitControlEvent();
        }
        

        public void InitControlEvent()
        {
            this.xucBar1.btnPrint_Click += 
                new UniMana.Utils.Controls.xucBar.ButtonClickHandler(
                    this.btnPrint_Click);
            ////this.xucBar1.btnExport_Click += 
            //new UniMana.Utils.Controls.xucBar.ButtonClickHandler(
            //    this.btnExportExcel_Click);
        }
        private void btnPrint_Click(object sender, ItemClickEventArgs e)
        {
            compositeLink_HienThi.ShowPreviewDialog();
        }

        /// <summary>
        /// load dữ liệu lên
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ReportStudent_Course_Load(object sender, EventArgs e)
        {
            //this.btnPrint.Size = new System.Drawing.Size(500, 37);
            grcStudent_Course.DataSource = 
                m_ReportStudent_Course.m_DCReadOnly.Catalogue_Courses.Student_Course(
                m_ReportStudent_Course.m_DCReadOnly.Training_Student_Classes, 
                m_ReportStudent_Course.m_DCReadOnly.Training_Students);

            cacStudent_Course.DataSource = 
                m_ReportStudent_Course.m_DCReadOnly.Catalogue_Courses.Student_Course(
                m_ReportStudent_Course.m_DCReadOnly.Training_Student_Classes, 
                m_ReportStudent_Course.m_DCReadOnly.Training_Students);
            cacStudent_Course.Series[0].ArgumentDataMember="Name";
            cacStudent_Course.Series[0].TopNOptions.Enabled = false;

          //cacStudent_Course.Series[0].ArgumentDataMember = "Name";
           // sideBySideBarSeriesLabel1.LineVisible = true;
         // cacStudent_Course.Series[0].Label = sideBySideBarSeriesLabel1;
             cacStudent_Course.Series[0].Name = "Số sinh viên từng khóa";
            cacStudent_Course.Series[0].TopNOptions.Enabled = true;
            cacStudent_Course.Series[0].ValueDataMembersSerializable = "TongCong";
           // sideBySideBarSeriesLabel2.LineVisible = true;
           // series2.Label = sideBySideBarSeriesLabel2;
           // series2.Name = "Series 2";
        }
    }
}